package com.xueyi.aixihu.reqeust;

import com.xueyi.aixihu.reqeust.base.PageLimitReq;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.Date;

/**
 * 文章类型查询条件
 */
@Data
public class NewsTypeReq extends PageLimitReq {
    private Integer id;
    /**
     * 类型名称
     */
    private String name;

    /**
     * 类型，1是镇，2是村或者社区
     */
    private Integer type;

    /**
     * 类型，1是镇，2是村或者社区字符串回显
     */
    private String typeStr;

    /**
     * 父id
     */
    private Integer pid;

    private Integer isValid;

    private String beginTime;
    private Date createTime;

    private String createTime1;
    private String endTime;

    public void format(){
        name = StringUtils.hasLength(name) ? name.trim():null;
        beginTime = StringUtils.hasLength(beginTime) ? beginTime.trim():null;
        endTime = StringUtils.hasLength(endTime) ? endTime.trim():null;
        countStartIndex();
    }
}
